package com.dylan.springcloud.ribbonfeignloadbalancer.controller;

import com.dylan.springcloud.common.util.LogUtil;
import com.dylan.springcloud.ribbonfeignloadbalancer.service.ClientAService;
import com.dylan.springcloud.ribbonfeignloadbalancer.service.ClientBService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * Created by Dylan on 2018/10/17.
 */
@RestController
public class TestController {

    @Autowired
    private ClientAService clientAService;
    @Autowired
    private ClientBService clientBService;

    @RequestMapping("/add")
    public String add(Integer a, Integer b) {
        LogUtil.info("开始发送请求");
        String result = clientAService.add(a, b);
        LogUtil.info(result);
        return result;
    }

    @RequestMapping("/sub")
    public String sub(Integer a, Integer b) {
        LogUtil.info("开始发送请求");
        String result = clientBService.sub(a, b);
        LogUtil.info(result);
        return result;
    }

}
